#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>

float samakarn(float x1)
{
  float samakarn1;
  samakarn1 = pow(x1,5)+pow(x1,3)+pow(x1,2)-1;
  return samakarn1;
}


float eabs(float value)
{
      
     return fabs(eabs(value)-eabs(value-1));       
}


float x1(float a,float b)
{
   float callsamakarnx;
   float callsamakarna; 
   float fa;
   float fax;  
   float x;
   float error;
   float erroreabs=0;
   int i;
  
   x=(a+b)/2;
   return x;
   error = eabs(erroreabs);
   printf("%f",error);
   if(error<=0.1)
     {
        callsamakarnx = samakarn(x); 
     }
     else
       {
           callsamakarna = samakarn(a);
           callsamakarnx = samakarn(x);
           fax = callsamakarna*callsamakarnx;
           
           if(fax<0)
           {
             return x1(x,b);
  
           }
           if(fax>0) 
           {
             return x1(a,x);
           }
           
       }
  

}



int main(){
       
       float a1=0,b1=1;
       float callx;
       float x;
       int i;
       float error1;
       
  
       for(i=0;error1>0.1;i++)
       {
       callx = x1(a1,b1);
       printf("%f",callx);
       }
      
        
       getch();
       return 0;
}
   


